/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.gov.mtc.dgac.licencias.bean;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author elvis
 */
@Entity
@Table(name = "TIPO_HALLAZGO")
@NamedQueries({@NamedQuery(name = "TipoHallazgoTO.findByCodTipoHallazgo", query = "SELECT t FROM TipoHallazgoTO t WHERE t.codTipoHallazgo = :codTipoHallazgo"), @NamedQuery(name = "TipoHallazgoTO.findByDescTipoHallazgo", query = "SELECT t FROM TipoHallazgoTO t WHERE t.descTipoHallazgo = :descTipoHallazgo"), @NamedQuery(name = "TipoHallazgoTO.findByAbrevTipoHallazgo", query = "SELECT t FROM TipoHallazgoTO t WHERE t.abrevTipoHallazgo = :abrevTipoHallazgo")})
public class TipoHallazgoTO implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "COD_TIPO_HALLAZGO", nullable = false)
    private Long codTipoHallazgo;
    @Column(name = "DESC_TIPO_HALLAZGO", nullable = false)
    private String descTipoHallazgo;
    @Column(name = "ABREV_TIPO_HALLAZGO", nullable = false)
    private String abrevTipoHallazgo;
    @OneToMany(mappedBy = "codTipoHallazgo")
    private Collection<HallazgoTO> hallazgoTOCollection;

    public TipoHallazgoTO() {
    }

    public TipoHallazgoTO(Long codTipoHallazgo) {
        this.codTipoHallazgo = codTipoHallazgo;
    }

    public TipoHallazgoTO(Long codTipoHallazgo, String descTipoHallazgo, String abrevTipoHallazgo) {
        this.codTipoHallazgo = codTipoHallazgo;
        this.descTipoHallazgo = descTipoHallazgo;
        this.abrevTipoHallazgo = abrevTipoHallazgo;
    }

    public Long getCodTipoHallazgo() {
        return codTipoHallazgo;
    }

    public void setCodTipoHallazgo(Long codTipoHallazgo) {
        this.codTipoHallazgo = codTipoHallazgo;
    }

    public String getDescTipoHallazgo() {
        return descTipoHallazgo;
    }

    public void setDescTipoHallazgo(String descTipoHallazgo) {
        this.descTipoHallazgo = descTipoHallazgo;
    }

    public String getAbrevTipoHallazgo() {
        return abrevTipoHallazgo;
    }

    public void setAbrevTipoHallazgo(String abrevTipoHallazgo) {
        this.abrevTipoHallazgo = abrevTipoHallazgo;
    }

    public Collection<HallazgoTO> getHallazgoTOCollection() {
        return hallazgoTOCollection;
    }

    public void setHallazgoTOCollection(Collection<HallazgoTO> hallazgoTOCollection) {
        this.hallazgoTOCollection = hallazgoTOCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codTipoHallazgo != null ? codTipoHallazgo.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TipoHallazgoTO)) {
            return false;
        }
        TipoHallazgoTO other = (TipoHallazgoTO) object;
        if ((this.codTipoHallazgo == null && other.codTipoHallazgo != null) || (this.codTipoHallazgo != null && !this.codTipoHallazgo.equals(other.codTipoHallazgo))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "licencias_dto.TipoHallazgoTO[codTipoHallazgo=" + codTipoHallazgo + "]";
    }

}
